package xjtu.zd.server.staff.data.dao;

import org.apache.ibatis.annotations.Select;

public interface DataDao {
    //DataAction
    @Select("select count(u_id) from t_user where u_id like concat(replace(#{date},'-',''),'%')")
    Integer getNewUserData(String date);
    @Select("select count(b_id) from t_book where b_id like concat(replace(#{date},'-',''),'%')")
    Integer getNewBookData(String date);
    @Select("select count(distinct u_id) from t_comment where c_date like concat(#{date},'%')")
    Integer getActiveUser(String date);



    //DateAction
    @Select("select min(concat(substring(u_id,1,4),'-',substring(u_id,5,2))) from t_user where u_id like concat('20','%')")
    String getEarUserDate();
    @Select("select min(concat(substring(b_id,1,4),'-',substring(b_id,5,2))) from t_book where b_id like concat('20','%')")
    String getEarBookDate();

}
